import { Body, Controller, Get, HttpCode, Inject, Post, Query } from '@nestjs/common';
import { FootballService } from './football.service';
import { RequireLogin, ResolveLogin, UserInfo } from 'src/common/decorator';
import { GetMatchAnalysisDto } from './dto/get-match-analysis.dto';

@Controller('football')
export class FootballController {
  @Inject(FootballService)
  private readonly footballService: FootballService;

  @Post('getDailyMatches')
  @HttpCode(200)
  @ResolveLogin()
  getDailyMatches(@Query('date') date: string, @Query('onlyToday') onlyToday?: boolean, @UserInfo('userId') userId?: string) {
    return this.footballService.getDailyMatches(date, onlyToday, userId);
  }

  @Post('getMatchAnalysis')
  @HttpCode(200)
  @ResolveLogin()
  getMatchAnalysis(@Body() body: GetMatchAnalysisDto, @UserInfo('userId') userId?: string) {
    return this.footballService.getMatchAnalysis(body?.matchId, userId);
  }

  @Post('getDailyRecommend')
  @HttpCode(200)
  getDailyRecommend() {
    return this.footballService.getDailyRecommend();
  }
}
